//
//  Demo.swift
//  learn-ios
//
//  Created by Dong on 2022/4/5.
//

import SwiftUI
import MediaPlayer

struct Demo: View {
    @State var isPlayer = false

    var body: some View {
        Button {
            let musicPlayer =  MPMusicPlayerController.applicationMusicPlayer
            musicPlayer.setQueue(with: .songs())
            
            isPlayer.toggle()
        }label: {
            Text("播放")
                .font(.title)
        }
    }
}

struct Demo_Previews: PreviewProvider {
    static var previews: some View {
        Demo()
    }
}
